﻿<UserControls:ScrumUserControl x:Class="ScrumTable.UI.View.WinTouch.UserControls.Tool.MemberChangeControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:s="http://schemas.microsoft.com/surface/2008"
    xmlns:Converter="clr-namespace:ScrumTable.UI.View.Converter;assembly=ScrumTable.UI.View" xmlns:Localization="clr-namespace:ScrumTable.UI.View.Localization;assembly=ScrumTable.UI.View" xmlns:UserControls="clr-namespace:ScrumTable.UI.View.WinTouch.UserControls" xmlns:CustomControl="clr-namespace:ScrumTable.UI.View.CustomControl;assembly=ScrumTable.UI.View" xmlns:GreyscaleEffectApp="clr-namespace:GreyscaleEffectApp;assembly=ScrumTable.UI.View" Background="#FFEFEFEF">
    <UserControl.Resources>
        <Converter:ConverterBoolVisibility x:Key="ConverterBoolVisibility" />    
    </UserControl.Resources>
    <GroupBox Localization:Translate.Uid="ToolsChangeLoginMember" Header="{Localization:Translate Default=[LoginMembers]}">
        <UserControls:SurfaceDragDropListBox x:Name="MemberList" HorizontalAlignment="Left"  VerticalAlignment="Top"  CanDrag="True"  AllowDrop="False" MultipleColumnsRows="False" Orientation="Horizontal" MinHeight="0" Background="Transparent" BorderBrush="Black" BorderThickness="0"  ItemsSource="{Binding LoginMembers}" SelectedItem="{Binding ScrumData.CurrentMember}" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden"> 
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Border HorizontalAlignment="Left" VerticalAlignment="Stretch"  Background="{Binding Color}" CornerRadius="5" BorderThickness="2" BorderBrush="Black" MinWidth="100" Margin="5,0,5,0">
                        <Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                            <Label HorizontalAlignment="Left"  Width="35" Height="35" Padding="0" IsHitTestVisible="False">
                                <CustomControl:WebAsyncReportMemberImage UriBitmap="{Binding Picture}" Width="30" Height="30" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Stretch"/>
                            </Label>
                            <Label HorizontalAlignment="Left"  Margin="35,0,0,0" Padding="0"  VerticalAlignment="Center" IsHitTestVisible="False">
                                <AccessText TextWrapping="WrapWithOverflow" Text="{Binding Name}">
                                </AccessText>
                            </Label>                            
                           
                        </Grid>
                        <Border.Style>
                            <Style>
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem}}}" Value="false">
                                        <Setter Property="Border.Effect">
                                            <Setter.Value>
                                                <GreyscaleEffectApp:GreyscaleEffect/>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Border.Style>
                    </Border>
                </DataTemplate>
            </ListBox.ItemTemplate>            
        </UserControls:SurfaceDragDropListBox>
    </GroupBox>
</UserControls:ScrumUserControl>
